<template>
  <div class="gameResult">
    <div class="title">
      <div class="title-left">
        <ul class="title-left-list">
          <li class="titleActive">
            <img src="../../assets/img/all.png" alt />
            <span>全部</span>
          </li>
          <li>
            <img src="../../assets/img/type2.png" alt />
            <span>英雄联盟</span>
          </li>
          <li>
            <img src="../../assets/img/type3.png" alt />
            <span>王者荣耀</span>
          </li>
          <li>
            <img src="../../assets/img/type1.png" alt />
            <span>CSGO</span>
          </li>
        </ul>
      </div>
      <div class="title-right">
        <el-dropdown trigger="click">
          <el-button type="primary">
            <span class="add-one">{{value1}}</span>
            <i class="el-icon-caret-bottom el-icon--right"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item @click.native="handleClick">黄金糕</el-dropdown-item>
            <el-dropdown-item>狮子头</el-dropdown-item>
            <el-dropdown-item>螺蛳粉</el-dropdown-item>
            <el-dropdown-item>双皮奶</el-dropdown-item>
            <el-dropdown-item>蚵仔煎</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <el-dropdown>
          <el-button type="primary">
            <span class="add-two">最近七天</span>
            <i class="el-icon-caret-bottom el-icon--right"></i>
          </el-button>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>黄金糕黄金糕黄金糕黄金糕黄金糕</el-dropdown-item>
            <el-dropdown-item>狮子头</el-dropdown-item>
            <el-dropdown-item>螺蛳粉</el-dropdown-item>
            <el-dropdown-item>双皮奶</el-dropdown-item>
            <el-dropdown-item>蚵仔煎</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </div>
    <div class="content nui-scroll">
      <ul class="match-list">
        <li v-for="v in 20" :key="v" class="match-list-content">
          <div class="match-top colorActive">
            <div class="line1">
              <img src="../../assets/img/lol.png" alt />
              <div>
                <p>06-10</p>
                <p>17:00</p>
              </div>
            </div>
            <div class="line2">
              <div>
                <span>FunPlus Phoenix</span>
                <img src="../../assets/img/game1.png" alt />
              </div>
              <div>
                <img src="../../assets/img/game2.png" alt />
                <span>LNG Esports</span>
              </div>
            </div>
            <div class="line3" @click="show($event)">
              <img src="../../assets/img/game3.png" alt />
              <div>
                <img style="width:65px;" src="../../assets/img/lolpankou.png" alt />
                <div>
                  <p>展开</p>
                  <img src="../../assets/img/zhankai.png" alt />
                </div>
              </div>
            </div>
          </div>
          <div class="open-message">
            <ul class="title">
              <li>盘口</li>
              <li>盘口结果</li>
            </ul>
            <ul v-for="v in 5" :key="v" class="list">
              <li>第 二 局的首杀</li>
              <li>
                <img src="../../assets/img/da.png" alt />
              </li>
            </ul>
          </div>
        </li>
      </ul>
      <ul class="match-list">
        <li v-for="v in 20" :key="v" class="match-list-content">
          <div class="match-top colorActive">
            <div class="line1">
              <img src="../../assets/img/lol.png" alt />
              <div>
                <p>06-10</p>
                <p>17:00</p>
              </div>
            </div>
            <div class="line2">
              <div>
                <span>FunPlus Phoenix</span>
                <img src="../../assets/img/game1.png" alt />
              </div>
              <div>
                <img src="../../assets/img/game2.png" alt />
                <span>LNG Esports</span>
              </div>
            </div>
            <div class="line3" @click="show($event)">
              <img src="../../assets/img/game3.png" alt />
              <div>
                <img style="width:65px;" src="../../assets/img/lolpankou.png" alt />
                <div>
                  <p>展开</p>
                  <img src="../../assets/img/zhankai.png" alt />
                </div>
              </div>
            </div>
          </div>
          <div class="open-message">
            <ul class="title">
              <li>盘口</li>
              <li>盘口结果</li>
            </ul>
            <ul v-for="v in 5" :key="v" class="list">
              <li>第 二 局的首杀</li>
              <li>
                <img src="../../assets/img/da.png" alt />
              </li>
            </ul>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import $ from "jquery";
export default {
  name: "gameResult",
  data() {
    return {
      activeName: "first",
      value1: "全部联赛"
    };
  },
  created() {
    this.getBeforeDate(7);
  },
  methods: {
    show(el) {
      var num = 1;
      $(el.target)
        .parents(".match-top")
        .siblings(".open-message")
        .slideToggle(500);
    },

    handleClick() {
      this.value1 = "黄金糕";
    },
    //用于获取日期
    getBeforeDate(number) {
      const num = number;
      const date = new Date();
      let day = date.getDate();
      date.setDate(date.getDate() - num);
      let year = date.getFullYear();
      let mon = date.getMonth() + 1;
      day = date.getDate();
      const s = year + "-" + mon + "-" + day;
      return s;
    }
  }
};
</script>
<style lang='less' scope>
@import url("../../assets/css/comm.css");
.gameResult {
  padding: 10px;
  .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    .title-left {
      width: 70%;
      .title-left-list {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        border-bottom: 1px solid #242948;

        > li {
          display: flex;
          justify-content: flex-start;
          align-items: center;
          margin-right: 15px;
          font-size: 14px;
          color: #8990c5;
          padding: 15px 10px;
          border-bottom: 2px solid #151a36;
          cursor: pointer;
          > img {
            margin-right: 10px;
          }
        }
      }
    }
  }
  .content {
    height: 80vh;
    overflow-y: scroll;
    display: flex;
    justify-content: space-between;
    .match-list {
      width: 49%;
      .match-list-content {
        margin: 0 0 20px;
        > .match-top {
          display: flex;
          justify-content: space-between;
          align-items: center;
          padding: 5px 20px;
          border-radius: 5px;
          > .line1 {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            > div {
              margin-left: 20px;
              p {
                font-size: 14px;
                color: #fff;
                font-weight: bold;
              }
            }
          }
          > .line2 {
            width: 70%;
            display: flex;
            justify-content: space-around;
            align-items: center;
            font-size: 14px;
            font-weight: bold;
            > div:nth-child(1),
            div:nth-child(2) {
              display: flex;
              justify-content: flex-start;
              align-items: center;
              span {
                margin: 0 10px;
                color: #fff;
              }
            }
          }
          > .line3 {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            > div {
              width: 60px;
              height: 60px;
              text-align: center;
              position: relative;
              margin-left: 15px;
              > img {
                position: absolute;
                left: 0;
                top: 0;
              }
              display: flex;
              justify-content: center;
              align-items: center;
              > div {
                font-size: 12px;
                text-align: center;
                color: #fff;
                > p {
                  padding-left: 5px;
                }
                > img {
                  margin-left: 7px;
                }
              }
            }
          }
        }
        > .match-top:hover {
          border: 1px solid #000;
        }
        > .open-message {
          margin: 10px 0;
          display: none;
          > ul {
            display: flex;
            justify-content: flex-start;
            > li {
              width: 50%;
              display: flex;
              align-items: center;
            }
          }
          > .title {
            color: #ebd2ab;
            font-size: 14px;
          }
          > .list {
            color: #fff;
            font-size: 12px;
            padding: 7px 10px;
            background-color: #252a48;
            margin-top: 10px;
            border-radius: 4px;
          }
        }
      }
    }
  }
  // -------------------------------------
.add-one {
  margin-right: 15px;
}
.add-one:before {
  content: "";
  display: inline-block;
  height: 12px;
  width: 20px;
  background: url("../../assets/img/bisai.png") no-repeat;
}
.add-two {
  margin-right: 15px;
}
.add-two:before {
  content: "";
  display: inline-block;
  height: 14px;
  width: 20px;
  background: url("../../assets/img/rqi.png") no-repeat;
}
.titleActive {
  border-bottom: 2px solid #d5b07d !important;
  color: #d5b07d !important;
}
.colorActive {
  border: 1px solid #4e8994;
  background: #1d3c4e;
}
}


</style>
